package com.xian.minespring.aop.metric;

import com.xian.minespring.annotation.Component;

/**
 * @author zhan
 * @version 2024/1/7
 */

@Component
public class HashWorker extends BaseWork{
    @Metric("SHA-1")
    public final String sha1(String input) {
        return hash("SHA-1", input);
    }

    @Metric("SHA-256")
    public String sha256(String input) {
        return hash("SHA-256", input);
    }


    @Metric("no")
    public String no(String input) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "sleep";
    }
}
